
package org.darcy.entity.work;

import java.io.Serializable;
import java.util.Date;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import lombok.extern.slf4j.Slf4j;

@Schema(description="WorkTask: 工作任务")
@TableName(value = "work_task")
@Getter
@Setter
@Slf4j
@Builder
@NoArgsConstructor
@AllArgsConstructor
public class WorkTask implements Serializable, Cloneable {

	private static final long serialVersionUID = 1L;

	@Schema(description = "")
	@TableId(type = IdType.AUTO)
	private Integer id;

	@Schema(description = "上级工作任务id")
	@TableField(value = "`pid`")
	private Integer pid;

	@Schema(description = "工作项id")
	@TableField(value = "`work_id`")
	private Integer workId;

	@Schema(description = "处理人")
	@TableField(value = "`operator`")
	private Integer operator;

	@Schema(description = "处理人姓名")
	@TableField(value = "`operator_name`")
	private String operatorName;

	@Schema(description = "审批意见")
	@TableField(value = "`comment`")
	private String comment;

	@Schema(description = "任务状态，0：草稿（待处理）；1：已处理；9：抄送；")
	@TableField(value = "`status`")
	private Integer status;

	@Schema(description = "任务状态，0：未读；1：已读；2：已处理")
	@TableField(value = "`read_status`")
	private Integer readStatus;

	@Schema(description = "创建时间")
	@TableField(value = "`create_time`")
	private Date createTime;

	@Schema(description = "更新时间")
	@TableField(value = "`update_time`")
	private Date updateTime;

	@Schema(description = "删除标识0：删除；1：存在")
	@TableField(value = "`del_flag`")
	private Integer delFlag;

	///

	@Schema(description = "流程状态名称")
	@TableField(exist = false)
	private String statusName;

	@Schema(description = "任务数量，按状态分组")
	@TableField(exist = false)
	private Integer statusCount;

	@Schema(description = "待处理任务数量")
	@TableField(exist = false)
	private int count1;

	@Schema(description = "已处理任务数量")
	@TableField(exist = false)
	private int count2;

	@Schema(description = "抄送任务数量")
	@TableField(exist = false)
	private int count3;

	// 查询参数

	@Schema(description = "任务类型：1：待处理；2：已处理；3：抄送我；")
	@TableField(exist = false)
	private Integer taskType;

	@Schema(description = "查询关键字")
	@TableField(exist = false)
	protected String keyword;

	@Schema(description = "查询开始时间")
	@TableField(exist = false)
	private Date queryBegin;

	@Schema(description = "查询结束时间")
	@TableField(exist = false)
	private Date queryEnd;
	

	@Schema(description = "当前任务id")
	@TableField(exist = false)
	private Integer taskId;
	
	@Schema(description = "转交人员")
	@TableField(exist = false)
	private Integer transferTo;

	// 审批参数

	@Schema(description = "审批是否同意")
	@TableField(exist = false)
	protected Boolean agree;

	public WorkTask clone() {
		WorkTask task = null;
		try {
			task = (WorkTask) super.clone();
		} catch (CloneNotSupportedException e) {
			log.error("WorkTask clone 失败", e);
		}
		return task;
	}

}
